<?php
class Core_Model_Character_Param
	extends Core_Model_Abstract
{
	const OBJ_TYPE	= 'PlayerParam';

	const PARAM_INT		= 0x1;
	const PARAM_CHAR	= 0x2;
	const PARAM_FLOAT	= 0x3;

	const LENGTH	= 45;
	
	protected $_id;
	
	protected $_type;
	
	protected $_name;
	
	public static function getTypes()
	{
		return array('INT'	=> self::PARAM_INT,
					'CHAR'	=> self::PARAM_CHAR,
					'FLOAT'	=> self::PARAM_FLOAT);
	}
	
	public function setType($type)
	{
		if (!in_array($type, self::getTypes()))
		{
			throw new Core_Model_Character_Params_Exception('Invalid type: [' . $type . ']');
		}	
		
		$this->_type	= $type;
	}

	public function setName($name)
	{
		$this->_name	= $name;
	}
	
	public function setId($id)
	{
		$this->_id	= (int) $id;
	}
	
	public function getId()
	{
		return $this->_id;
	}
	
	public function getName()
	{
		return $this->_name;
	}	
	
	public function getType()
	{
		return $this->_type;
	}
}